<script setup lang="ts">
const images=[{
  src: './src/assets/images/cat.jpg',
  href: '/category/CATS'
},{
  src: './src/assets/images/dog.jpg',
  href: '/category/DOGS'
},{
  src: './src/assets/images/fish.jpg',
  href: '/category/FISH'
},{
  src: './src/assets/images/bird.jpg',
  href: '/category/BIRDS'
},{
  src: './src/assets/images/reptile.jpg',
  href: '/category/REPTILES'
}
]
</script>

<template>
  <div style="width: 50%;display: inline-block;margin-left: 5ex">
    <el-carousel :interval="4000" type="card" height="200px">
      <el-carousel-item v-for="img in images" :key="img">
        <router-link :to="img.href">
          <el-image :src="img.src" fit="cover" style="height: 200px;width: 100%"></el-image>
        </router-link>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<style scoped>
.el-carousel__item h3 {
  color: #475669;
  opacity: 0.75;
  line-height: 200px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
</style>